package example;

import java.util.HashMap;
import java.util.HashSet;
import java.util.List;

import com.zz.check.JarChecker;
import com.zz.check.meta.JarInfo;
import com.zz.check.util.JarConflictDetectUtil;

public class Test {

    public static void main(String[] args){
		List<JarInfo> lst = new JarChecker().check("D:/temp/lib1");
		for(JarInfo jar:lst){
			System.out.println(jar);
			System.out.println(jar.getDependentClasses());
			System.out.println(jar.getDependentJars());
			System.out.println(jar.getCycleJars());
			System.out.println(jar.getTroubleClasses());
		}
		
		checkConflict();
	}
    
    //检测类冲突
    public static void checkConflict(){
    	long start=System.currentTimeMillis();
		String pathname="D:\\temp\\lib1";
		HashMap<String, HashSet<String>> conflictMap=JarConflictDetectUtil.getConflict(pathname);
		
		for(String jarName :conflictMap.keySet()){
			System.out.println(jarName);
			System.out.println(conflictMap.get(jarName).toString());
		}

		System.out.println("jar解结束，累计耗时： "+(System.currentTimeMillis()-start)+" 毫秒");
    }
            
}
